<!DOCTYPE html>
<html>
<head>
    <title>添加</title>
    <script src="/static/js/jquery-2.1.1.js"></script>
    <script src="/static/bootstrap/js/bootstrap.js"></script>
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <!--引用layui弹框插件-->
    <script src="/static/layui/layui.all.js"></script>
    <script src="/static/layui/layui.js"></script>
    <link href="/static/layui/css/layui.css" rel="stylesheet"/>
    <script src="/static/layui/lay/modules/layer.js"></script>

    <!--弹框js-->
    <script src="/static/js/yii.js"></script>

    {if condition="$swidthStyle eq 0"}
    <link href="/static/css/pattern/public.css" rel="stylesheet"/>
    {else/}
    <link href="/static/css/default/public.css" rel="stylesheet"/>
    {/if}
</head>
<body>
<style>
    html, body{background-color:#FFF!important;}
    .modal-body{background-color:#fff;padding:15px}
    .page-header{margin-top:15px!important;}
    .add_button{border-top:1px solid #eee;padding-top:15px;}
    .config_img {
        height:65px;
        margin-top: 15px;
    }
    .images_del{text-align: center}
    .layui-form-pane .layui-form-label{font-size:12px!important;}
    .modal-body{display: inline-block;padding-bottom:78px;}
    .show_multiple{float: left;margin-left:15px;}
    #images_upload{display: inline-block;float: left;padding:0px 10px;}
</style>

<div class="modal-body">



    <form class="layui-form layui-form-pane form-horizontal" action="" name="layui-form" >
        <div class="layui-form-item layui-col-md12">
            <label class="layui-form-label">*年度</label>
            <div class="input-group col-xs-4" style="float: left">
                <input type="text" name="plan_title" placeholder="年度" class="layui-input test-item" value="{$detail.plan_title}" >
            </div>

        </div>

        <div class="layui-form-item layui-col-md12">
            <label class="layui-form-label layui-col-md-offset1">计划投资金额</label>
            <div class="input-group col-xs-4" style="float: left">
                <input type="text" class="layui-input" name="plan_investment" placeholder="计划投资金额" value="{$detail.plan_investment}" >
                <span class="input-group-addon">万元</span>
            </div>
        </div>

        <!--<div class="layui-form-item layui-col-md12">-->
            <!--<label class="layui-form-label">时间</label>-->
            <!--<div class="layui-col-md4">-->
                <!--<input type="text" name="show_time" class="layui-input test-item" placeholder="时间" >-->
            <!--</div>-->
        <!--</div>-->

        <!--图文模型&单页模型-->
        <div class="layui-form-item" >
            <a class="layui-form-label" title="*本年度重要工作节点推进计划::" href="javascript:;" style="height:60px;" >年度重要工作<br/>节点推进计划:</a>
            <div class="layui-col-md8" style="line-height: 65px;padding-left:125px" id="content">
                {$detail.plan_content}
            </div>
        </div>


        <input type="hidden" name="pro_id" value="{$pro_id}">

    </form>

</div>

<script>

    var pro_id = {$pro_id};
    layui.extend({
        tinymce: '/static/tinymce/tinymce'
    });
    layui.use(['form','tinymce','laydate','transfer'], function() {
        var form = layui.form
            , layer = layui.layer;
        var tinymce = layui.tinymce;
        var transfer = layui.transfer;
        var laydate = layui.laydate;




        lay('.test-item').each(function(){
            laydate.render({
                elem: this
                ,trigger: 'click'
                ,type:'year',
                change:function (value) {
                    console.log(value);
                    $.ajax({
                        type: "post",
                        url: "{:URL('project/figure/planApi')}",
                        data: {year:value,pro_id:pro_id},
                        dataType: "json",
                        success: function (res) {
                            if(res!=''){
                                $('input[name="plan_investment"]').val(res.plan_investment);
                                $('#content').html(res.plan_content);
                            }
                        }
                    });
                }
            });
        });




        form.render();
    });



</script>

</body>
</html>